//
//  BaseViewController.m
//  WhiteNoise
//
//  Created by 王亮 on 2020/8/11.
//  Copyright © 2020 liang. All rights reserved.
//

#import "TestViewController.h"
#import "TestViewModel.h"
#import "TestView.h"

@interface TestViewController ()
@property (nonatomic, strong) TestViewModel *testViewModel;
@property (nonatomic, strong) TestView *testView;
@end

@implementation TestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view addSubview:self.testView];
    [self.testView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

- (TestView *)testView {
    if(!_testView){
        _testView = [[TestView alloc] initWithViewModel:self.testViewModel];
        [_testView.click_cell subscribeNext:^(id  _Nullable x) {
            NSLog(@"%@",x);
        }];
    }
    return _testView;
}
- (TestViewModel *)testViewModel {
    if(!_testViewModel){
        _testViewModel = [[TestViewModel alloc] init];
    }
    return _testViewModel;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
